package com.flurry.android;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import java.util.ArrayList;

public class CacheSearchItemsData extends al
{
  private static String TAG = "CacheSearchData";

  public CacheSearchItemsData(Context paramContext, String paramString)
  {
    this.cD = dw.e(paramContext, paramString);
    this.cE = "searchItemsTable";
  }

  public void addItem(String paramString1, String paramString2, long paramLong)
  {
    Log.d(TAG, "--- Insert in mytable: ---");
    SQLiteDatabase localSQLiteDatabase = this.cD.getWritableDatabase();
    ContentValues localContentValues = new ContentValues();
    localContentValues.put("objectsId", paramString1);
    localContentValues.put("objectsLocalId", paramString2);
    localContentValues.put("timestamp", Long.valueOf(paramLong));
    long l = localSQLiteDatabase.insert(this.cE, null, localContentValues);
    Log.d(TAG, "row inserted, ID = " + l);
  }

  public ArrayList<String> getItemsById(String paramString)
  {
    ArrayList localArrayList = new ArrayList();
    Cursor localCursor = this.cD.getReadableDatabase().query(this.cE, null, "objectsId='" + paramString + "'", null, null, null, null);
    if (localCursor.moveToFirst())
    {
      int i = localCursor.getColumnIndex("objectsLocalId");
      do
        localArrayList.add(localCursor.getString(i));
      while (localCursor.moveToNext());
    }
    localCursor.close();
    return localArrayList;
  }

  public void readAll()
  {
    Cursor localCursor = this.cD.getReadableDatabase().query(this.cE, null, null, null, null, null, null);
    if (localCursor.moveToFirst())
    {
      int i = localCursor.getColumnIndex("objectsId");
      int j = localCursor.getColumnIndex("objectsLocalId");
      int k = localCursor.getColumnIndex("timestamp");
      do
        Log.w(TAG, "id = " + localCursor.getString(i) + ", objects_id = " + localCursor.getString(j) + ", timestamp = " + localCursor.getLong(k));
      while (localCursor.moveToNext());
    }
    while (true)
    {
      localCursor.close();
      return;
      Log.w(TAG, "TABLE IS EMPTY");
    }
  }

  public void removeItemsById(String paramString)
  {
    this.cD.getWritableDatabase().delete(this.cE, "objectsId='" + paramString + "'", null);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.CacheSearchItemsData
 * JD-Core Version:    0.6.2
 */